saveXml Method |
This method saves the XML document in the local store for the duration mentioned in the expiration date.
Syntax
bSuccess = object.saveXml(sName, oXmlDocument , dExpirationDate);
Parameters
Parameter |
Description |
---|---|
sName |
Required. String that will be used as the name of the XML document created. |
oXmlDocument |
Required. XML object that will form the content of the new document created in the local store. |
dExpirationDate |
Optional. String that denotes the date till which the XML document will be saved in the local store. |
Return Value
Returns one of the following possible values.
true |
XML document is successfully saved in the local store. |
false |
XML document could not be saved. |
Remarks
This method will not add the saved XML document to Local_Store_Index file ,which has the root nodes of all the XML files in the local store created using the createXml() method of the buslocalstore component.
If the expiration date is not mentioned in the parameter list, the document is saved forever.
Example
The following example shows how to save an XML document to the local store.
var oTimeNow = new Date(); oTimeNow.setDate(oTimeNow.getDate() + parseInt(expiryDurationValue)); var sExpirationDate = oTimeNow.toUTCString(); // oPersist is the Id of the buslocalstore object oPersist.saveXml("myData", xmlData.XMLDocument.documentElement, sExpirationDate);